﻿<views:CallsView
    xmlns:Controls="clr-namespace:Microsoft.Phone.Maps.Controls;assembly=Microsoft.Phone.Maps"
    xmlns:ControlPushpin="clr-namespace:Microsoft.Phone.Maps.Toolkit;assembly=Microsoft.Phone.Controls.Toolkit"
    x:Class="SpaceNeedle.x6473.WindowsPhone.Views.Calls"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:views="clr-namespace:SpaceNeedle.x6473.WindowsPhone.Views"
    xmlns:controls="clr-namespace:SpaceNeedle.x6473.WindowsPhone.Controls"
    xmlns:viewmodels="clr-namespace:SpaceNeedle.x6473.WindowsPhone.ViewModels"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True" shell:SystemTray.Opacity="0">

    <phone:PhoneApplicationPage.Resources>
        <shell:ApplicationBar x:Name="appBar1" IsVisible="True" IsMenuEnabled="True" Mode="Default" Opacity="1.0" >
            <shell:ApplicationBarIconButton x:Name="listAppBarButton" IconUri="/Assets/AppBar/manage.png" Text="lista" Click="OnListAppBarButton_Click"/>
            <shell:ApplicationBarIconButton x:Name="mapAppBarButton" IconUri="/Assets/AppBar/globe.png" Text="mapa" Click="OnMapAppBarButton_Click"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem x:Name="uploadsMenuItem" Text="uploads" Click="OnUploadsMenuItem_Click"/>
                <shell:ApplicationBarMenuItem x:Name="aboutMenuItem" Text="sobre" Click="OnAboutMenuItem_Click"/>
                <shell:ApplicationBarMenuItem x:Name="signoutMenuItem" Text="sair" Click="OnSignOutMenuItem_Click"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
        <shell:ApplicationBar x:Name="appBar2" IsVisible="True" IsMenuEnabled="True" Mode="Default" Opacity="1.0" >
            <!--<shell:ApplicationBarIconButton x:Name="filtersAppBarButton2" IconUri="/Assets/AppBar/search.refine.png" Text="filtros" Click="OnFiltersAppBarButton_Click"/>-->
            <shell:ApplicationBarIconButton x:Name="mapAppBarButton2" IconUri="/Assets/AppBar/globe.png" Text="mapa" Click="OnMapAppBarButton_Click"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem x:Name="uploadsMenuItem2" Text="uploads" Click="OnUploadsMenuItem_Click"/>
                <shell:ApplicationBarMenuItem x:Name="aboutMenuItem2" Text="sobre" Click="OnAboutMenuItem_Click"/>
                <shell:ApplicationBarMenuItem x:Name="signoutMenuItem2" Text="sair" Click="OnSignOutMenuItem_Click"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
        <shell:ApplicationBar x:Name="appBar3" IsVisible="True" IsMenuEnabled="True" Mode="Default" Opacity="1.0" >
            <!--<shell:ApplicationBarIconButton x:Name="filtersAppBarButton3" IconUri="/Assets/AppBar/search.refine.png" Text="filtros" Click="OnFiltersAppBarButton_Click"/>-->
            <shell:ApplicationBarIconButton x:Name="listAppBarButton3" IconUri="/Assets/AppBar/manage.png" Text="lista" Click="OnListAppBarButton_Click"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem x:Name="uploadsMenuItem3" Text="uploads" Click="OnUploadsMenuItem_Click"/>
                <shell:ApplicationBarMenuItem x:Name="aboutMenuItem3" Text="sobre" Click="OnAboutMenuItem_Click"/>
                <shell:ApplicationBarMenuItem x:Name="signoutMenuItem3" Text="sair" Click="OnSignOutMenuItem_Click"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.Resources>

    <Grid x:Name="LayoutRoot" Background="Transparent">
        
        <Grid Name="mapContainer" Visibility="Collapsed">
            <Controls:Map Name="map" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                
            </Controls:Map>
            
            <StackPanel Margin="12,17,0,0"  VerticalAlignment="Top" HorizontalAlignment="Left">
                <TextBlock Text="{Binding AppContent.Name}" Style="{StaticResource PhoneTextNormalStyle}"  Foreground="Black" FontFamily="Segoe WP SemiLight"/>
                <TextBlock Text="{Binding AppContent.Home.CallsSectionTitle}"  Margin="9,20,0,0" Style="{StaticResource PhoneTextTitle1Style}"  Foreground="Black" FontFamily="Portable User Interface"/>
            </StackPanel>
            <!--<Grid Margin="40,30,0,0" VerticalAlignment="Top" HorizontalAlignment="Left">
                <TextBlock Text="{Binding AppContent.Name}" Style="{StaticResource PhoneTextNormalStyle}" Foreground="Black" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top"/>
            </Grid>-->
        </Grid>

        <Grid Name="pivotContainer">
        <!--TitlePanel contains the name of the application and page title-->
            <StackPanel Margin="12,17,0,0" VerticalAlignment="Top" HorizontalAlignment="Left">
                <TextBlock Text="{Binding AppContent.Name}" Style="{StaticResource PhoneTextNormalStyle}" FontFamily="Segoe WP SemiLight"/>
                <TextBlock Text="{Binding AppContent.Home.CallsSectionTitle}" Margin="9,20,0,0" Style="{StaticResource PhoneTextTitle1Style}"  FontFamily="Portable User Interface"/>

            </StackPanel>


        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Margin="28,180,0,0">

                <ListBox x:Name="requestItemsListBox" Grid.Row="1" Margin="0,0,0,0" ItemsSource="{Binding RequestItems}" SelectionChanged="OnRequestItemsListBox_SelectionChanged">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal" Margin="0,0,0,20">
                                <StackPanel Orientation="Vertical" Background="{StaticResource PhoneAccentBrush}" >
                                    <Border Width="96" Height="76" VerticalAlignment="Top">
                                        <Image Source="{Binding RequestIcon}" Width="64" Height="64" Stretch="UniformToFill" VerticalAlignment="Center"/>
                                    </Border>
                                    <Border Background="#30000000" Height="30">
                                        <TextBlock FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold" Foreground="White" Text="{Binding Status, Converter={StaticResource RequestItemStatusToStringConverter},ConverterParameter=true}" />
                                    </Border>
                                </StackPanel>
                                <StackPanel Orientation="Vertical" Margin="10,0,0,0">
                                    <TextBlock FontSize="30" Text="{Binding RequestTitle}" TextWrapping="NoWrap" TextTrimming="WordEllipsis" Width="340"/>
                                    <TextBlock FontSize="22" Text="{Binding Address}" FontWeight="Bold" TextWrapping="NoWrap" TextTrimming="WordEllipsis" Width="340"/>
                                    <TextBlock FontSize="22" Margin="0,0,0,0" Text="{Binding Description}" TextWrapping="NoWrap" TextTrimming="WordEllipsis" Width="340"/>
                                    <toolkit:ContextMenuService.ContextMenu>
                                        <toolkit:ContextMenu IsZoomEnabled="false">
                                            <toolkit:MenuItem Header="Compartilhar" Foreground="Black" Tag="{Binding}" 
                                                  Click="OnShareTicket_Click" />
                                        </toolkit:ContextMenu>
                                    </toolkit:ContextMenuService.ContextMenu>
                                </StackPanel>
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>

                <!--<phone:Pivot x:Name="pivot" Margin="0" SelectionChanged="OnPivot_SelectionChanged">
                --><!--<phone:PivotItem x:Name="filters" Header="{Binding StaticContent.FiltersSectionName}">
                    <Grid>
                        <TextBlock Text="{Binding StaticContent.FilterTitle}" Style="{StaticResource PhoneTextSmallStyle}" HorizontalAlignment="Left" VerticalAlignment="Top" Foreground="Black"/>
                        <StackPanel Margin="0,50,0,0">
                            --><!--<StackPanel>
                                <TextBlock Text="{Binding StaticContent.NeighborhoodFilterName}" Style="{StaticResource PhoneTextSmallStyle}" HorizontalAlignment="Left" VerticalAlignment="Top" Foreground="Black"/>
                                <toolkit:ListPicker VerticalAlignment="Top" Margin="12,0">
                                    <ListBoxItem Content="Bancários" Foreground="#FF0051FF"/>
                                    <ListBoxItem Content="Copacabana" Foreground="#FF0051FF"/>
                                    <ListBoxItem Content="Ipanema" Foreground="#FF0051FF"/>
                                </toolkit:ListPicker>
                            </StackPanel>-->
                            <!--<StackPanel Margin="0,25,0,0">
                                <TextBlock Text="{Binding StaticContent.OriginFilterName}" Style="{StaticResource PhoneTextSmallStyle}" HorizontalAlignment="Left" VerticalAlignment="Top" Foreground="Black"/>
                                <toolkit:ListPicker VerticalAlignment="Top" Margin="12,0">
                                    <ListBoxItem Content="Todos" Foreground="#FF0051FF"/>
                                    <ListBoxItem Foreground="#FF0051FF" Content="Celular"/>
                                    <ListBoxItem Foreground="#FF0051FF" Content="Web"/>
                                </toolkit:ListPicker>
                            </StackPanel>--><!--
                            <StackPanel Margin="0,25,0,0">
                                <TextBlock Text="{Binding StaticContent.ServicesFilterName}" Style="{StaticResource PhoneTextSmallStyle}" HorizontalAlignment="Left" VerticalAlignment="Top" Foreground="Black"/>
                                <toolkit:ListPicker VerticalAlignment="Top" Margin="12,0" ItemsSource="{Binding Requests}">
                                    <toolkit:ListPicker.ItemTemplate>
                                        <DataTemplate>
                                            <TextBlock Text="{Binding Title}" Foreground="#FF0051FF"/>
                                        </DataTemplate>
                                    </toolkit:ListPicker.ItemTemplate>
                                </toolkit:ListPicker>
                            </StackPanel>
                        </StackPanel>
                    </Grid>
                </phone:PivotItem>--><!--
                <phone:PivotItem x:Name="list" Header="{Binding StaticContent.ListingSectionName}">
                    <ListBox x:Name="requestItemsListBox" Grid.Row="1" Margin="24,0,25,0" ItemsSource="{Binding RequestItems}" SelectionChanged="OnRequestItemsListBox_SelectionChanged">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal" Margin="0,0,0,20">
                                    <StackPanel Orientation="Vertical" Background="{StaticResource PhoneAccentBrush}" >
                                        <Border Width="96" Height="76" VerticalAlignment="Top">
                                            <Image Source="{Binding RequestIcon}" Width="64" Height="64" Stretch="UniformToFill" VerticalAlignment="Center"/>
                                        </Border>
                                        <Border Background="#30000000" Height="30">
                                            <TextBlock FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold" Foreground="White" Text="{Binding Status, Converter={StaticResource RequestItemStatusToStringConverter},ConverterParameter=true}" />
                                        </Border>
                                    </StackPanel>
                                    <StackPanel Orientation="Vertical" Margin="10,0,0,0">
                                        <TextBlock FontSize="30" Foreground="White" Text="{Binding RequestTitle}" TextWrapping="NoWrap" TextTrimming="WordEllipsis" />
                                        <TextBlock FontSize="22" Text="{Binding Address}" FontWeight="Bold" TextWrapping="NoWrap" TextTrimming="WordEllipsis" />
                                        <TextBlock FontSize="22" Margin="0,0,0,0" Foreground="White" Text="{Binding Description}" TextWrapping="NoWrap" TextTrimming="WordEllipsis"/>
                                        <toolkit:ContextMenuService.ContextMenu>
                                            <toolkit:ContextMenu IsZoomEnabled="false">
                                                <toolkit:MenuItem Header="Compartilhar" Foreground="Black" Tag="{Binding}" 
                                                  Click="OnShareTicket_Click" />
                                            </toolkit:ContextMenu>
                                        </toolkit:ContextMenuService.ContextMenu>
                                    </StackPanel>
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </phone:PivotItem>
                <phone:PivotItem x:Name="mapItem" Header="{Binding StaticContent.MapSectionName}">
                </phone:PivotItem>
            </phone:Pivot>-->
            </Grid>
        </Grid>

        <ProgressBar Visibility="{Binding IsInProgress, Converter={StaticResource BooleanToVisibilityConverter}}" Style="{StaticResource ProgressStyle}" VerticalAlignment="Top" />
        <controls:NewtworkStatusControl/>

    </Grid>
</views:CallsView>